<template>
  <HeaderOne :activeIndex="activeIndex"></HeaderOne>
  <el-row>
    <el-col class="flex items-center justify-center font-600 text-3xl" style="padding-top: 30px; padding-bottom: 30px;">
      企业信息管理
    </el-col>
  </el-row>
  <el-row>
    <el-col class="input-style">
      <el-card :shadow="'always'" style="width: 50%">
        <enterprise-info-form
            :form="form"
            :disabled="false"
        @submitUpdate="submitUpdate"
        ></enterprise-info-form>
      </el-card>
    </el-col>
  </el-row>
</template>

<script setup>

import {entInfoManage, updateInfo} from "@/api/apiPath/onePartApi.js"
import {onMounted, ref} from 'vue'
import HeaderOne from "@/components/header/headOne.vue"
import EnterpriseInfoForm from "@/components/form/enterpriseInfoForm.vue";
import {getOptionInfo, initFormInfo} from "@/api/methods/initInfo.js";
import {updateEnterpriseForm} from "@/api/methods/updateInfo.js";


const activeIndex = ref(`/enterpriseinfo`)
const form = ref({
  qydm: '',
  qymc: '',
  fzr: '',
  fzrtel: '',
  xydm: '',
  addr: '',
  zyyw: '',
  zycp: '',
  jygm: '',
  dwjj: '',
  businessLicense: '',
  cardX: '',
  cardY: '',
  qtpic: '',
})

onMounted(async ()=> {
  try {
    form.value = await getOptionInfo(entInfoManage())
    console.log(form.value.businessLicense)
  } catch (e) {
    console.log(e)
  }
  // initFormInfo(entInfoManage(), form)
})

const submitUpdate = ()=> {
  updateEnterpriseForm(updateInfo(), form, entInfoManage())
}

</script>

<style scoped>
.input-style {
  @apply class="flex items-center justify-center";
}
</style>








